Adding a Rule to an Export Rule Set

After you create an export rule set by using the protocol exportruleset new command, you create one or more export rules for the rule set by using the protocol exportruleset rule new command. When you create an export rule, you specify the following information:

Valid security types are as follows. You can specify a comma-separated list of multiple security types for a rule. If you specify the security type as any or never, do not specify any other security types.

The following example creates an export rule on a virtual server named vs0 in an export rule set named rs1. The rule has the index number 1. The rule matches all clients. The rule enables all NFS access. It enables read-only access by all clients and requires Kerberos authentication for read-write access. Clients with the UNIX user ID 0 (zero) are mapped to user ID 65534 (which normally maps to the user name nobody). The rule enables suid and sgid access but does not enable the creation of devices.

node::> protocol exportruleset rule new -vserver vs0
-rulesetname rs1 -ruleindex 1 -protocol nfs -clientmatch 0.0.0.0
-rorule any -rwrule krb5 -anon 65534 -allow-suid true -allow-dev false

Displaying Information about Export Rules

The protocol exportruleset rule show command, by default, displays the following information about export rules:

  • Virtual server name

  • Export rule set name

  • Export rule index number

  • Access protocol

  • Client match

  • Read-only access rule

  • Read-write access rule

Other information is displayed in a detailed view and if other parameters are specified. See the reference page for the command for details.

The following example displays information about all export rules.

node::> protocol exportruleset rule show
Virtual  Ruleset  Rule   Access    Client            RO      RW
Server   Name     Index  Protocol  Match             Rule    Rule
vs0      rs1      1      nfs       0.0.0.0           any     krb5
vs0      rs1      2      any       10.98.40.0/12     any     any
vs0      rs1      3      any       .example.com      ntlm,   ntlm,
                                                     krb5    krb5

Modifying an Export Rule

To modify the attributes of an export rule, use the protocol exportruleset rule modify command. The command cannot modify the index number of a rule in its rule set; to do this, use the protocol exportruleset rule setindex command.

The following example modifies the export rule with index number 2 in an export rule set named rs1 on a virtual server named vs0. The client match is changed to a netgroup named group1, and NTLM or Kerberos authentication is required for read-write access.

node::> protocol exportruleset rule modify -vserver vs0
-rulesetname rs1 -ruleindex 2 -clientmatch @group1 -rwrule ntlm,krb5

Setting an Export Rule's Index Number

The protocol exportruleset rule setindex command enables you to modify the index number of a specified export rule. If the new index number is already in use, the command reorders the list to accommodate it. If the existing index is given a higher index number (that is, later in the list), the command decrements the index numbers of rules between the moved rule and moved-to rule; otherwise, the command increments the index numbers between the moved-to rule and the existing rule.

The following example changes the index number of an export rule at index number 3 to index number 2 in an export rule set named rs1 on a virtual server named vs0.

node::> protocol exportruleset rule setindex -vserver vs0
-rulesetname rs1 -ruleindex 3 -newruleindex 2

Deleting an Export Rule

To delete an export rule from a rule set, use the protocol exportruleset rule delete command. When you delete a rule, the other rules in the rule set are not automatically renumbered or reordered. To reorder the rules in a rule set, use the protocol exportruleset rule setindex command.

The following example deletes an export rule set with the index number 3 from an export rule set named rs1 on a virtual server named vs0.

node::> protocol exportruleset rule delete -vserver vs0
-rulesetname rs1 -ruleindex 3